package com.byton.order.feign.fallback;

import com.byton.order.feign.ProductFeignClient;
import com.byton.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * Description:
 *
 * @Author byteon (liyong98k@163.com)
 * @Create 2025-04-09 16:18
 */
@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    @Override
    public Product getProductById(Long id) {
        System.out.println("兜底回调被触发，商品ID: " + id);
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal("0"));
        product.setProductName("未知商品");
        product.setNum(0);
        return product;
    }
}
